proc DC_10000 { req } {
	global dbConnection
        set handle $dbConnection
	puts "in DC_10000:req=$req"
	list_to_array $req r_array
	set login_account [string trim $r_array(Login_Account) ]
	set login_passwd  [string trim $r_array(Login_Passwd)  ]
	set contact       [string trim  $r_array(Contact) ]
	set contact_mobile [string trim $r_array(Contact_Mobile) ]
	set user_type     [string trim $r_array(User_Type)  ]
	set email 	  [string trim $r_array(Email) ]
	set cust_kind    00 

		set sql "select max(cust_id)+1 from lbs_customer "
		set result [::mysql::sel $handle $sql -list ]
		if {[lindex $result 0] == "{}" } {
			set cust_id 1
		} else {
			set cust_id [lindex $result 0]
		}
		set sql "select max(account_id)+1 from lbs_account "
		set result [::mysql::sel $handle $sql -list ]
		if {[lindex $result 0] == "{}" } {
			set account_id 1
		}  else {
			set account_id [lindex $result 0]
		}
		set sql "select max(user_id)+1 from lbs_subscription"
		set result [::mysql::sel $handle $sql -list ]
		puts "subs_id= $result"
		if { [lindex $result 0 ] == "{}" } {
			set user_id 1
		} else {
			set user_id [lindex $result 0]
		}
		
		set sql "insert into lbs_customer(cust_id,cust_name,cust_kind,login_account,login_password,contact,contact_mobile) values($cust_id,'$cust_name','$cust_kind','$login_account','$login_passwd','$contact','$contact_mobile')"
		puts $sql
		set result [::mysql::exec $handle $sql]
		set sql "insert into lbs_account(account_id,cust_id,account_name,email) values($account_id,$cust_id,'$contact','$account_addr','$email')";
		puts $sql
		set result [::mysql::exec $handle $sql]
		set sql "insert into lbs_subscription(user_id,cust_id,account_id,user_type,svc_num,join_date,user_passwd) values($user_id,$cust_id,$account_id,'$user_type','$login_account',now(),$login_passwd)"
		puts $sql
		set result [::mysql::exec $handle $sql]
		return "{{00000} {{$user_id} {$account_id} {$cust_id}} }"

	
}
